package com.jh.fcsm.beans.basic;

import com.alibaba.excel.annotation.ExcelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.jh.fcsm.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.ibatis.type.JdbcType;
import tk.mybatis.mapper.annotation.ColumnType;
import javax.persistence.*;

/**
 * 行政区划对象 basic_area_code
 
 * 
 * @author cjt
 * @date 2023-03-07
 */
@Table(name = "basic_area_code")
@ApiModel(value = "com.jh.fcsm.beans.basic.BasicAreaCode", description = "行政区划")
public class BasicAreaCode extends BaseEntity{
    private static final long serialVersionUID = 1L;
    @ExcelProperty("行政区划代码")
	@Column(name = "CODE")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value="行政区划代码")
	private String code;
    @ExcelProperty("行政区划名称")
	@Column(name = "NAME")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value="行政区划名称")
	private String name;
    @ExcelProperty("父级区划代码")
	@Column(name = "PARENT_CODE")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value="父级区划代码")
	private String parentCode;
    @ExcelProperty("父级区划名称")
    @Transient
    private String parentName;

    /**
     * SET 行政区划代码
     * @param code
     */
    public void setCode(String code){
		this.code = code == null ? null :code;
	}
    /**
     * GET 行政区划代码
     * @return code
     */
    public String getCode(){
        return code;
    }
    /**
     * SET 行政区划名称
     * @param name
     */
    public void setName(String name){
		this.name = name == null ? null :name;
	}
    /**
     * GET 行政区划名称
     * @return name
     */
    public String getName(){
        return name;
    }
    /**
     * SET 父级区划代码
     * @param parentCode
     */
    public void setParentCode(String parentCode){
		this.parentCode = parentCode == null ? null :parentCode;
	}
    /**
     * GET 父级区划代码
     * @return parentCode
     */
    public String getParentCode(){
        return parentCode;
    }
    @Override
	public String toString() {
	    return  ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
	}

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public String getParentName() {
        return parentName;
    }
}
